package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 自然醒
 * @version 1.0
 */
@Mapper
public interface SetmealDishMapper {
    /**
     * 根据dishId查询菜品是否跟套餐关联
     * @param dishId
     */
    @Select("select * from setmeal_dish where dish_id = #{dishId}")
    List<SetmealDish> selectIsRelatedWithSetmeal(Long dishId);

    /**
     * 插入套餐和菜品的关联
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 根据套餐id查询套餐和菜品的关联
     * @param id
     * @return
     */
    List<SetmealDish> getSetmealDishBySetmealId(Long id);

    /**
     * 删除套餐和菜品的关联
     * @param id
     */
    void deleteBySetmealId(List<Long> ids);
}
